home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #14 / Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO / math / maca_101.zip / DERIVE.DEM < prev    next >
Text File  |  1996-01-30  |  2KB  |  61 lines

  1. ;DERIVE.DEM
  2. ;DEMO FILE FOR MASSCALC VERSION 1.00
  3. ;WRITTEN BY: Ralph W. Reid
  4. ;This file may only be distributed in its unmodified form.
  5. ;
  6. ;DESCRIPTION:  This file primarily demonstrates derivative calculations.
  7. ;
  8. ;For the latest releases of MASSCALC and other software created by
  9. ;Ralph W. Reid, see http://www2.athenon.com/~rreid/products/00-index.html.
  10. ;
  11. ;HOW TO USE THIS FILE:  This file may be piped into MASSCALC, and its
  12. ;output displayed as follows:
  13. ;TYPE DERIVE.DEM | MASSCALC | MORE
  14. ;This file may be redirected into MASSCALC and its output displayed
  15. ;as follows:
  16. ;MASSCALC < DERIVE.DEM | MORE
  17. ;These two commands should be run from the operating system prompt.
  18.  
  19. ;display the first and second derivative approximations of a ximple equation
  20. ;variables used in derivative calculations must be assigned a value first
  21. x = 3;
  22. print: "current _der_delta value is" _der_delta
  23. print: "x and the approximate first and second derivatives of x^2:"
  24. x;
  25. derivative_1 (x, x^2);
  26. derivative_2 (x, x^2);
  27.  
  28. print: "current _fund_der_delta value is" _fund_der_delta
  29. print: "results for above equations using fundamental theorum of calculus"
  30. print: "for the calculations:"
  31. derivative (1, x, x^2);
  32. derivative (2, x, x^2);
  33.  
  34.  
  35. ;change delta values and recalculate
  36. _der_delta = _der_delta * 10;
  37. print:
  38. print: "_der_delta changed to" _der_delta
  39. print: "now results are:"
  40. derivative_1 (x, x^2);
  41. derivative_2 (x, x^2);
  42.  
  43. _fund_der_delta = _fund_der_delta * 10;
  44. print:
  45. print: "_fund_der_delta changed to" _fund_der_delta
  46. print: "fundamental derivative results are now:"
  47. derivative (1, x, x^2);
  48. derivative (2, x, x^2);
  49.  
  50. ;find the derivatives of a list of values
  51. create array: list [1, 5];
  52. list = 1, 4, 9, 16, 25;
  53. print:
  54. print: "finding the derivatives of a list of values whose delta is 1.0:"
  55. print: "initial list:" list
  56. print: "first derivatives:"
  57. derive_list (1, list);
  58. print: "second derivatives:"
  59. derive_list (1, derive_list (1, list));
  60.  
  61.